// pages/feedback/issue/issue.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    uploadFiles:[]

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  chooseIma:function(res){
    var that = this
    var uploadFiles = this.data.uploadFiles
    wx.chooseImage({
      success(res) {
        console.log(res)
        const tempFilePaths = res.tempFilePaths
        uploadFiles.push(tempFilePaths)
        console.log(uploadFiles)
        that.setData({
          uploadFiles: uploadFiles
        })
      }
    })
  },
  //删除图片
  close:function(res){
    console.log(res)
    var idx = res.currentTarget.dataset.idx
    console.log(idx)
    var uploadFiles = this.data.uploadFiles
    uploadFiles.splice(idx,1)
    console.log(uploadFiles)
    this.setData({
      uploadFiles: uploadFiles
    })
  }


})